<?php
/**
 * Created by PhpStorm.
 * User: leo
 * Date: 2018/5/22
 * Time: 10:42
 */
include "../classes/logincheck.php";
include '../classes/conn.php';
if(islogin()!='stu_login'){
    die('error');
}
$new_psw=$_POST['psw'];
$class=$_POST['class'];
$query="update student set psw='{$new_psw}' where num='{$_SESSION['stu_num']}' and class={$class}";
$res=mysql_query($query);
if($res){
    echo '1';
    unset($_SESSION['stu_num']);
}
else echo '0';